home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.07 Jul 90 / Tuning MPW ƒ / Draggin' Dragon / DragonModule.m < prev    next >
Encoding:
Modula Implementation  |  1989-08-26  |  791 b   |  38 lines  |  [TEXT/MPS ]

  1. (******************************************************)
  2. (*                                                      *)
  3. (*    file:  DragonModule.m                              *)
  4. (*                                                      *)
  5. (*    Dragon method - see definition module for          *)
  6. (*    description.                                      *)
  7. (*                                                      *)
  8. (*    Written in SemperSoft Modula-2 v.1.1.2              *)
  9. (*                                                      *)
  10. (*    Allen Stenger    August 1989                        *)
  11. (*                                                      *)
  12. (******************************************************)
  13.  
  14. IMPLEMENTATION MODULE DragonModule;
  15.  
  16. FROM Pen        IMPORT Go, Turn;
  17.  
  18. PROCEDURE Dragon( order : INTEGER );
  19. BEGIN
  20.     IF order = 0
  21.     THEN    
  22.         Go( 10 );
  23.     ELSE
  24.         IF order > 0
  25.         THEN
  26.             Dragon( order - 1 );
  27.             Turn( 90 );
  28.             Dragon( 1 - order );
  29.         ELSE
  30.             Dragon( -1 - order );
  31.             Turn( -90 );
  32.             Dragon( 1 + order );
  33.         END; (* IF *)
  34.     END; (* IF *)
  35. END Dragon;
  36.  
  37. BEGIN
  38. END DragonModule.